package com.zjeav.lingjiao.base.adapter;

import android.content.Context;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.zjeav.lingjiao.R;
import com.zjeav.lingjiao.base.baseBean.Book;

/**
 * 我的课程
 */
public class MyBookAdapter extends BaseQuickAdapter<Book, BaseViewHolder> {
    private Context context;
    private int mType = 0;

    public MyBookAdapter(Context context) {
        super(R.layout.mybook_item);
        this.context = context;
    }


    @Override
    protected void convert(BaseViewHolder helper, Book item) {

        helper.setText(R.id.subject, item.getSubject());
        helper.setText(R.id.title, item.getTitle());
        helper.setText(R.id.press, item.getPress());
        helper.setText(R.id.downloadtime, item.getFavoritesTime());
        helper.setText(R.id.action_txt, "学习");

        ImageView imageView = helper.getView(R.id.image);
        Glide.with(context)
                .load(item.getCover())
                .into(imageView);


        helper.addOnClickListener(R.id.action_txt);

    }
}